package com.xydpeng.rpc.common.model;

import io.netty.util.Recycler;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author xydpeng
 * @version v1.0
 * @date: 2023/4/13
 * @description:
 */
@Getter
@Setter
public class FastRpcResponse<T> implements Serializable {
    private Recycler.Handle<FastRpcResponse> handle;

    private int code;
    private String msg;
    private T data;

    public FastRpcResponse() {
    }

    public FastRpcResponse(Recycler.Handle<FastRpcResponse> handle) {
        this.handle = handle;
    }

    public void recycle() {
        handle.recycle(this);
    }
}
